<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page language="java" contentType="text/html; charset=utf-8"
         pageEncoding="utf-8"%>
<%@page isELIgnored="false" %>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<title></title>
<link rel="stylesheet" href="../css/pintuer.css">
<link rel="stylesheet" href="../css/admin.css">
<script src="../js/jquery.js"></script>
<script src="../js/pintuer.js"></script>
</head>
<body>
<script>

    $(function(){
        var max=${max};
        var num = 0;
        $(":checkbox").each(function(){
            $(this).click(function(){
                if($(this)[0].checked) {
                    ++num;
                    if(num == max) {
                    //alert("最多选择 三项 的上限已满, 其他选项将会变为不可选.");
                        $(":checkbox").each(function(){
                            if(!$(this)[0].checked) {
                                $(this).attr("disabled", "disabled");
                            }
                        });
                    }
                } else {
                    --num;
                    if(num <= max) {
                        $(":checkbox").each(function(){
                            if(!$(this)[0].checked) {
                                $(this).removeAttr("disabled");
                            }
                        });
                    }
                }
            });
        });
    })
</script>
<div class="panel admin-panel">
  <div class="panel-head" id="add"><strong><span class="icon-pencil-square-o"></span>预定会议</strong></div>
  <div class="body-content">
    <form method="post" class="form-x" action="MeetingServlet?flag=2" onsubmit="return checknumber()">
<%--        预订人id--%>
        <input type="hidden" value="1" name="wId"/>
      
      <div class="form-group">
        <div class="label">
          <label>会议名称：</label>
        </div>
        <div class="field">
          <input type="text" class="input w50" value="" name="mName" data-validate="required:请输入会议名称" />
          <div class="tips"></div>
        </div>
      </div>
    <div class="form-group">
        <div class="label">
            <label></label>
        </div>
        <div class="field">

            <div class="tips" style="color:red">! 由于会议室容量限制，您只能选择 ${max} 个人开会哦 !</div>
        </div>
    </div>
      

    <input type="hidden" name="tStart" value="${starttime}">
    <input type="hidden" name="tEnd" value="${endtime}">
    <input type="hidden" name="rId" value="${roomid}">

    <div class="form-group">
        <div class="label">
            <label>请选择参会人员：</label>
        </div>
        <div class="field">
<%--            <input name="test1" type="checkbox" value="">--%>
            <c:forEach items="${workers}" var="worker" varStatus="status">
                <c:if test="${status.index%5==0}">
                    <br>
                </c:if>


                <input type="checkbox" name="work" value="${worker.id}"/>${worker.uname} &nbsp;&nbsp;

            </c:forEach>
            <div class="tips"></div>
        </div>

    </div>

     
      
      
      <div class="form-group">
        <div class="label">
          <label></label>
        </div>
        <div class="field">
          <button class="button bg-main icon-check-square-o" type="submit"> 提交</button>
        </div>
      </div>
      
      
    </form>
  </div>
</div>
</body>
</html>